<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>用户详情</title>
    <script src="../commonCss.js"></script>
    <script src="../commonJs.js"></script>
    <link rel="stylesheet" href="../../css/common.css">
    <style type="text/css">
        tr{
            line-height: 35px
        }
        .title-div{
            height:40px;
            width: 100%;
        }

        font{
            cursor: pointer;
        }
        .tyle{
            width:150px;
            text-align: right;
        }
        #viewCon{
            float:left;
            height:120px;
            margin-left: 20px;
        }
        #viewCon span{
            padding-left:3px;
        }
        .resultclas{
            color:red;
        }
        .radioHand{
            cursor: pointer;
        }
        .basicinfo{
            font-weight: bold;
            padding-right: 13px;
        }
    </style>
</head>

<body class="hold-transition skin-blue sidebar-mini">

<section class="content-header">

    <ol class="breadcrumb">
        <li><a href="userList.html">用户管理</a></li>
        <li class="active">用户信息详情</li>
    </ol>
    <ul class="nav nav-tabs " style="padding-top: 15px;padding-left: 10px;">
        <li class="active" onclick="showUserCrowdfund()"><a href="#tab_1" data-toggle="tab" aria-expanded="false" style="font-size: 16px;">众筹记录</a></li>
        <li class="" onclick="showUserBankCard()"><a href="#tab_2" data-toggle="tab" aria-expanded="false" style="font-size: 16px;">银行卡</a></li>
        <li class="" onclick="showUserPoints()"><a href="#tab_3" data-toggle="tab" aria-expanded="false" style="font-size: 16px;">积分</a></li>
        <li class="" onclick="showUserCreditPoints()"><a href="#tab_4" data-toggle="tab" aria-expanded="false" style="font-size: 16px;">信用分</a></li>
        <li class="" onclick="showUserUsableAmt()"><a href="#tab_6" data-toggle="tab" aria-expanded="false" style="font-size: 16px;">可用额度</a></li>
        <li class="" onclick="showUserInfo()"><a href="#tab_5" data-toggle="tab" aria-expanded="false" style="font-size: 16px;">基本资料</a></li>
    </ul>

    <div class="tab-content" style="padding:15px">
        <!-- 用户众筹记录 -->
        <div class="tab-pane active" id="tab_1">
            <section class="content" >
                <div class="row">
                    <div class="col-xs-12" style="padding-left: inherit;">
                        <div class="box-header">
                            <form class="form-inline">
                                <label>查询:</label>
                                <div class="form-group">
                                    <select class="form-control" id="flag">
                                        <option value="">全部</option>
                                        <option value="1">江湖救急</option>
                                        <!--<option value="2">还房贷</option>-->
                                        <!--<option value="3">还车贷</option>-->
                                        <!--<option value="4">还信用卡</option>-->
                                        <option value="5">求助</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <input type="text" id="searchCrowd" class="form-control" style="width: 235px" placeholder="输入标题/用户账号/筹集金额搜索"/>
                                </div>

                                <div class="form-group">
                                    <button type="button" onclick="showUserCrowdfund();"  class="btn btn-block btn-primary">搜索</button>
                                </div>
                            </form>

                        </div>
                        <!-- 数据列表展示 -->
                        <div class="box-body" style="height:100%;">
                            <table id="crowdfundList" class="table table-bordered table-hover;" >
                                <thead>
                                <tr>
                                    <th>标题</th>
                                    <th>类型</th>
                                    <th>用户账号</th>
                                    <th>众筹金额</th>
                                    <th>已筹金额</th>
                                    <th>账单金额</th>
                                    <th>账单图片</th>
                                    <th>开始时间</th>
                                    <th>结束时间</th>
                                    <th>状态</th>
                                    <!--<th>操作</th>-->
                                </tr>
                                </thead>
                                <tbody>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </section>
        </div>

        <!-- 我的银行卡信息 -->
        <div class="tab-pane" id="tab_2" >
            <section class="content" >
                <div class="row">
                    <div class="col-xs-12" style="padding-left: inherit;">
                        <div class="box-header">
                            <form class="form-inline">
                                <div class="form-group">
                                    <label>查询:</label>
                                    <input type="text" id="searchBankCard" class="form-control" placeholder="输入信用卡名称搜索"/>
                                </div>

                                <div class="form-group">
                                    <button type="button" onclick="showUserBankCard();"  class="btn btn-block btn-primary">搜索</button>
                                </div>
                            </form>

                        </div>
                        <!-- 数据列表展示 -->
                        <div class="box-body" style="height:100%;padding-top: inherit;">
                            <table id="bankCardList" class="table table-bordered table-hover;" >
                                <thead>
                                <tr>
                                    <th>银行卡卡号</th>
                                    <th>银行名称</th>
                                    <th>银行英文简称</th>
                                    <th>卡类别</th>
                                    <th>还款日</th>
                                    <th>账单日</th>
                                    <th colspan="2" style="width: 8%;">卡状态</th>
                                    <th>添加时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </section>
        </div>

        <!-- 用户积分记录 -->
        <div class="tab-pane" id="tab_3">
            <section class="content" >
                <div class="row">
                    <div class="col-xs-12" style="padding-left: initial;">
                        <div  style="border-top: 0px;">
                            <div class="box-header">
                                <form class="form-inline">
                                    <div class="form-group">
                                        <label>日期筛选:</label>
                                        <input type="text" id="pointStartDate" style="padding-left:3px;width: 150px;" class="form-control" placeholder="开始时间" >
                                    </div>
                                    <div class="form-group">
                                        <label>至</label>
                                    </div>
                                    <div class="form-group">
                                        <input type="text" id="pointEndDate" style="padding-left:3px;width: 150px;" class="form-control" placeholder="结束时间">
                                    </div>
                                    <div class="form-group">
                                        <button type="button" onclick="showUserPoints();"  class="btn btn-block btn-primary">搜索</button>
                                    </div>

                                    <div class="form-group" style="float: right">
                                        <font color="#006400" size="5px">总积分：</font><span style="color: red;font-size: 25px;" id="totalPoint">1000</span>
                                    </div>
                                </form>

                            </div>
                            <!-- 数据列表展示 -->
                            <div class="box-body" style="height:100%;">
                                <table id="pointsList" class="table table-bordered table-hover;" >
                                    <thead>
                                    <tr>
                                        <th>积分ID</th>
                                        <th>积分类型</th>
                                        <th>积分</th>
                                        <th>时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>

        <!-- 用户信用分记录 -->
        <div class="tab-pane" id="tab_4">
            <section class="content" >
                <div class="row">
                    <div class="col-xs-12" style="padding-left: initial;">
                        <div  style="border-top: 0px;">
                            <div class="box-header">
                                <form class="form-inline">
                                    <label>查询:</label>
                                    <div class="form-group">
                                        <select class="form-control" id="creditFlag" onchange="showUserCreditPoints()">
                                            <option value="">全部</option>
                                            <option value="1">发红包</option>
                                            <option value="2">互助</option>
                                            <option value="3">登录</option>
                                            <option value="4">其他</option>
                                            <option value="5">违规</option>
                                            <option value="6">申诉</option>
                                        </select>
                                    </div>
                                    <div class="form-group" style="float: right">
                                        <font color="#006400" size="5px">总信用分：</font><span style="color: red;font-size: 25px;" id="totalCreditPoint">1000</span>
                                    </div>
                                </form>

                            </div>
                            <!-- 数据列表展示 -->
                            <div class="box-body" style="height:100%;">
                                <table id="creditPointsList" class="table table-bordered table-hover;" >
                                    <thead>
                                    <tr>
                                        <th>信用分类型</th>
                                        <th>信用分</th>
                                        <th>原因</th>
                                        <th>创建时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>

        <!-- 用户基本信息 -->
        <div class="tab-pane" id="tab_5">
            <div class='title-div'>
                <span style="font-size: 18px;font-weight: bold;padding-left: 10px;">基本资料</span>
                <div style="float: right">
                    <button type="button" class="btn btn-block btn-primary" onclick="editUserInfo()">编辑用户资料</button>
                </div>
            </div>

            <table>
                <tr>
                    <td class="basicinfo" align="right">用户ID：</td>
                    <td id="id" ></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">账号：</td>
                    <td id="account" align="left"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">钱包总金额：</td>
                    <td id="walletTotal" ></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">红包总金额：</td>
                    <td id="redbagTotal" ></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">用户总积分：</td>
                    <td id="userPoint"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">用户总信用分：</td>
                    <td id="creditPoint"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">是否Plus会员：</td>
                    <td id="isPlus"></td>
                </tr>
                <tr id="plusTime" style="display: none;">
                    <td class="basicinfo" align="right">会员到期时间：</td>
                    <td id="plusExpireTime"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right" >头像：</td>
                    <td>
                        <img id="avatar" style="border:1px dashed #ddd;width:80px;" onclick="maxPic(this.src)">
                    </td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">昵称：</td>
                    <td id="username"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">性别：</td>
                    <td id="gender"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">年龄：</td>
                    <td id="age"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">手机号：</td>
                    <td id="mobile"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">身份证号：</td>
                    <td id="idCard"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">人脸校验分数：</td>
                    <td id="value"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">真实姓名：</td>
                    <td id="partyName"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">抢红包次数：</td>
                    <td id="sysRedbagCount"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">大转盘次数：</td>
                    <td id="sysWheelCount"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">兑换大转盘剩余次数：</td>
                    <td id="convertWheelCount"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">本月剩余众筹次数：</td>
                    <td id="crowdfundCount"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">贡献值：</td>
                    <td id="contribution"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">用户状态：</td>
                    <td id="status"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">注册时间：</td>
                    <td id="createTime"></td>
                </tr>
                <tr>
                    <td class="basicinfo" align="right">可用额度：</td>
                    <td id="userUsableAmt" ></td>
                </tr>
            </table>
        </div>

        <!-- 用户可用额度记录 -->
        <div class="tab-pane" id="tab_6">
            <section class="content" >
                <div class="row">
                    <div class="col-xs-12" style="padding-left: initial;">
                        <div  style="border-top: 0px;">
                            <div class="box-header">
                                <form class="form-inline">
                                    <label>查询:</label>
                                    <div class="form-group">
                                        <select class="form-control" id="searchType_usableAmt" onchange="showUserUsableAmt()">
                                            <option value="">全部</option>
                                            <option value="0">永久额度</option>
                                            <option value="1">临时额度</option>
                                        </select>
                                    </div>
                                    <div class="form-group" style="float: right">
                                        <font color="#006400" size="5px">可用额度：</font><span style="color: red;font-size: 25px;" id="usableAmt"></span>&nbsp;&nbsp;&nbsp;
                                        <font color="#006400" size="5px">永久额度：</font><span style="color: red;font-size: 25px;" id="permanentAmt"></span>&nbsp;&nbsp;&nbsp;
                                        <font color="#006400" size="5px">临时额度：</font><span style="color: red;font-size: 25px;" id="fixedAmt"></span>
                                    </div>
                                </form>

                            </div>
                            <!-- 数据列表展示 -->
                            <div class="box-body" style="height:100%;">
                                <table id="usableAmtList" class="table table-bordered table-hover;" >
                                    <thead>
                                    <tr>
                                        <th>类型</th>
                                        <th>额度</th>
                                        <th>原因</th>
                                        <th>时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>
</section>

<!--【编辑用户】弹出窗内容  start-->
<div id="editUser" class="mask_cover" style="z-index:1000">
    <div class="maskbox" style="width:800px;height:470px;">
        <div class="mask_title">
            <span style="font-size: 19px">编辑用户</span>
            <div class="remove">
                <span class="glyphicon glyphicon-remove modfly"></span>
            </div>
        </div>
        <div class="marginauto">
            <div class="mess" id="info2" style="color:red;text-align: center;padding: 3px;margin-top: -15px;" ></div>
            <form id="editUserForm" class="">
                <div class="unitbox">
                    <div  >
                        <span style="width:111px;height:35px; display: inline-block;padding-top: 8px; background: #eee;border-right: 1px solid #ddd;text-align: center;">账号：</span>
                        <span id="accountInfo" style="padding-left: 10px;"></span>
                        <input type="hidden" name="id"  />
                        <span id="accountValid2" class="glyphicon" ></span>
                    </div>
                    <div class="dp_box" style="border: 1px solid #ddd;height: 90px;line-height: 110px;" >
                        <span class="dp_tle">头像：</span>
                        <img  id="img2" src="" style="border:1px dashed #ddd;width: 100px;height: 80px;margin-bottom: 25px;">

                        <input type="hidden" name="avatar" id="head">
                        <div class="dp_btnbox" id="container">
                            <a href="javascript:;" id="pickfiles" class="file">
                                <input type="file" name="picUrl" id="picUrl"  accept="image/png,image/gif,image/jpeg,image/jpg" onchange="uploadPic()" />
                            </a>

                        </div>
                        <span class="show_type" style="margin-left: 29%;"><font color="red">*仅限png、jpg格式图片&nbsp;&nbsp;</font>
                        <div style="width: 20%;float: right;">
                            <div id="picUrlProgress" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>
                        </div>
                  <span id="result2" class="resultclas"></span></span>

                    </div>
                    <table class="table table-bordered ">
                        <tbody>
                        <tr>
                            <td class="table_tle blcor">昵称:</td>
                            <td><input class="form-control table_input" id="usernames" name="username"></td>

                            <td class="table_tle blcor">手机号：</td>
                            <td><input class="form-control table_input" id="mobiles"  name="mobile" readonly="readonly"></td>
                        </tr>
                        <tr>
                            <td class="table_tle blcor">真实姓名：</td>
                            <td><input class="form-control table_input" id="partyNames" name="partyName"></td>

                            <td class="table_tle blcor">地址:</td>
                            <td><input class="form-control table_input" id="address" name="address"></td>
                        </tr>
                        <tr>
                            <td class="table_tle ">*状态:</td>
                            <td>
                                <select class="form-control" id="statuss" name="status" style="width:90%;">
                                    <option value="0">正常</option>
                                    <option value="1">冻结</option>
                                </select>
                            </td>
                            <td class="table_tle blcor">性别：</td>
                            <td>
                                <select class="form-control" id="genders" name="gender" style="width:90%;">
                                    <option value="0">未知</option>
                                    <option value="1">男</option>
                                    <option value="2">女</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="table_tle blcor">身份证：</td>
                            <td><input name="idCard" id="idCards" class="form-control table_input" readonly="readonly"></td>

                            <td class="table_tle blcor">年龄：</td>
                            <td><input class="form-control table_input" name="age" id="ages"></td>
                        </tr>

                        </tbody>
                    </table>

                    <div class="modal-footer" style="text-align: center">
                        <button type="button" onclick="closePanel()" class="btn btn-default">取消</button>
                        <button type="button" id="editUserInfoSub" class="btn btn-primary">保存</button>
                    </div>

                </div>
            </form>
        </div>
    </div>
</div>

<!-- 【查看银行卡消费记录】弹出窗内容 -->
<div class="modal" id="cardCostDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" data-backdrop="static" >
    <div class="modal-dialog">
        <div class="modal-content" style="width: 180%;height: 75%;margin-left: -40%;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span>
                    <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" align="center">银行卡消费记录列表</h4>
            </div>
            <div class="box-body" style="height:100%;">
                <table id="cardCostList" class="table table-bcardordered table-hover;table-layout:fixed;" >
                    <thead>
                    <tr>
                        <th>卡号后缀</th>
                        <th>交易金额</th>
                        <th>交易摘要</th>
                        <th>交易日期</th>
                        <th>记账日期</th>
                    </tr>
                    </thead>
                    <tbody >
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<!-- 【查看银行卡月度记录】弹出窗内容 -->
<div class="modal" id="cardMonthDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" data-backdrop="static" >
    <div class="modal-dialog">
        <div class="modal-content" style="width: 180%;height: 75%;margin-left: -40%;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span>
                    <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" align="center">银行卡月度账单列表</h4>
            </div>
            <div class="box-body" style="height:100%;">
                <table id="cardMonthList" class="table table-bcardordered table-hover;table-layout:fixed;" >
                    <thead>
                    <tr>
                        <th>账单周期</th>
                        <th>信用额度</th>
                        <th>本期还款总额</th>
                        <th>本期最低还款额</th>
                        <th>到期还款日</th>
                    </tr>
                    </thead>
                    <tbody >
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<!-- 【信用扣分】弹出窗内容 -->
<div class="modal" id="punishDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span>
                    <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" align="center" >信用扣分处罚</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" onsubmit="return false">
                    <fieldset  style="margin-top: 1%;">
                        <div class="form-group">
                            <label class="col-md-2 control-label">扣除分数：</label>
                            <div class="col-md-10">
                                <select id="punishScore" class="form-control input-sm" style="width: 45%;">
                                    <option value="-5">5</option>
                                    <option value="-10">10</option>
                                    <option value="-15">15</option>
                                    <option value="-20">20</option>
                                    <option value="-25">25</option>
                                    <option value="-30">30</option>
                                    <option value="-35">35</option>
                                    <option value="-40">40</option>
                                    <option value="-45">45</option>
                                    <option value="-50">50</option>
                                </select>
                            </div>
                            <label class="col-md-2 control-label" style="color: red;">*扣分原因：</label>
                            <div class="col-md-10">
                                <textarea  id="reason" rows="12" cols="63"  style="margin-top: 2%;margin-bottom: 2%;">
                                </textarea>

                                <label class="control-label" style="color: #0aa66e">常用原因：</label>
                                <select id="selReason" class="form-control" style="width: 85%;float: right;" onchange="selText()">
                                    <option value="">--请选择--</option>
                                    <option value="上传账单与实际消费不符合">上传账单与实际消费不符合</option>
                                    <option value="账单不真实">账单不真实</option>
                                    <option value="账单图片模糊">账单图片模糊</option>
                                    <option value="不是本人账单">不是本人账单</option>
                                </select>
                            </div>
                        </div>
                    </fieldset>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="confirmSubmit();">确定</button>
            </div>
        </div>
    </div>
</div>

<!-- 【驳回】弹出窗内容 -->
<div class="modal" id="rejectDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span>
                    <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" align="center" >众筹单驳回</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" onsubmit="return false">
                    <fieldset  style="margin-top: 1%;">
                        <div class="form-group">
                            <label class="col-md-2 control-label" style="color: red;">*驳回原因：</label>
                            <div class="col-md-10">
                                <textarea  id="rejectResion" rows="12" cols="63"  style="margin-top: 2%;margin-bottom: 2%;" >
                                </textarea>

                                <label class="control-label" style="color: #0aa66e">常用原因：</label>
                                <select id="selRejectReason" class="form-control" style="width: 85%;float: right;" onchange="selRejectText()">
                                    <option value="">--请选择--</option>
                                    <option value="上传账单与实际消费不符合">上传账单与实际消费不符合</option>
                                    <option value="账单不真实">账单不真实</option>
                                    <option value="账单图片模糊">账单图片模糊</option>
                                    <option value="不是本人账单">不是本人账单</option>
                                </select>
                            </div>
                        </div>
                    </fieldset>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="confirmReject();">确定</button>
            </div>
        </div>
    </div>
</div>

<!-- 【图片点击放大】弹出窗内容 -->
<div class="modal" id="picMonthDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" align="center">图片</h4>
            </div>
            <img id="maxPic" width="100%">
        </div>
    </div>
</div>

</body>

    <script>
        //获取详情用户的id
        var id = getUrlParam("userId");
        //获取用户总积分
        var userTotalPoint = getUrlParam("userPoint");
        //获取用户总信用分
        var userTotalCredit = getUrlParam("userCredit");
        //日期插件相关
        $.datetimepicker.setLocale('zh');
        $("#pointStartDate,#pointEndDate").datetimepicker({
            inline:false,	//true-显示，false - 隐藏
            format: 'Y-m-d',
            timepicker: false, //true-显示时间，false - 不显示时间
            height : "50px"
            // minDate : 0 ,//最小日期今天
        });

        //页面初始化加载数据
        $(document).ready(function() {
            layui.use('layer', function(){
                var layer = layui.layer;
            });
            showUserCrowdfund();
            getTotalUsableAmt("");
        });

        //根据ID查询用户信息
        function showUserInfo(){
            $.ajax({
                type:"POST",
                url:"/user/getUserById",
                async : true,//默认就是true
                dataType:"json",
                data:{id : id},
                success:function(result){
                    if(result != null){
                        showUserDetail(result.data.user);
                    }
                },
                failure:function(result) {
                    layer.msg('网络错误！');
                },
            });
        }

        //展示用户信息
        function showUserDetail(user){
            $("#id").text(user.id);
            $("#account").text(user.account);
            $("#avatar").attr("src",user.avatar);
            $("#username").text(user.username);
            if(user.gender == 0){
                $("#gender").text("未知");
            }else if(user.gender == 1){
                $("#gender").text("男");
            }else{
                $("#gender").text("女")
            }
            $("#mobile").text(user.mobile);
            $("#age").text(user.age);
            $("#address").text(user.address);
            $("#redbagTotal").text(user.redbagTotal.toFixed(2)+"元");
            $("#walletTotal").text(user.wallet.toFixed(2)+"元");

            $("#value").text(user.value);
            $("#idCard").text(user.idCard);
            $("#partyName").text(user.partyName);
            $("#sysRedbagCount").text(user.sysRedbagCount);
            $("#sysWheelCount").text(user.sysWheelCount);
            $("#convertWheelCount").text(user.convertWheelCount);
            $("#userPoint").text(user.userPoint);
            $("#creditPoint").text(user.creditPoint);
            $("#crowdfundCount").text(user.crowdfundCount);
            $("#contribution").text(user.contribution);

            if( user.isPlus == 1){
                $("#plusExpireTime").text(toDate(user.plusExpireTime).format('yyyy-MM-dd'));
                $("#plusTime").css("display","contents");
            }

            user.isPlus == 0?$("#isPlus").text("否"):$("#isPlus").text("是");
            if (user.status == 0) {
                $("#status").text("正常");
            } else if (user.status == 1) {
                $("#status").text("冻结")
            } else if (user.status == 2) {
                $("#status").text("注销")
            }
            $("#createTime").text(toDate(user.createTime).format('yyyy-MM-dd HH:mm:ss'));
        }

        //查询我的银行卡信息
        function showUserBankCard(){
            var searchBankCard = $("#searchBankCard").val();
            var table = $('#bankCardList').DataTable({
                "destroy": true,   //可以重新初始化，用于搜索
                "lengthChange": false,
                "ordering": false,   //排序
                "info": true,		   //
                "autoWidth": false,   //宽度自动
                "paging": true,      //分页
                "searching": false,  //全局搜索关闭
                "processing": true,  //开启显示‘正在加载.../processing’
                "serverSide":true,   //true代表后台处理分页，false代表前台处理分页
                "ajax" :  {
                    url:"/card/getCardByUserId",
                    type:"post",
                    async : true,//默认就是true
                    dataType:"json",
                    data:{
                            "cardKey" : searchBankCard,
                            "userId" : id
                    },
                    dataSrc: function (myJson) {
                        return myJson.data.data;
                    }
                },
                //参数显示
                "columns": [
                    {"data": "cardNum", 'sClass': "text-center",'width': '12%'},
                    {"data": "bankName", 'sClass': "text-center",'width': '12%'},
                    {"data": "enBankName", 'sClass': "text-center",'width': '10%'},
                    {"data": "type", 'sClass': "text-center",'width': '15%',
                        "render":function( data, type, full, meta) {
                            var str;
                            if(data == 0){
                                str = "信用卡";
                            }else if(data == 1){
                                str = "储蓄卡";
                            }else if(data == 2){
                                str = "支付宝";
                            }
                            return str;
                        }
                    },
                    {"data": "backDay", 'sClass': "text-center",'width': '7%',
                        "render":function( data, type, full, meta) {
                            if(data != 0){
                                return "每月"+ data +"号";
                            }else{
                                return "无";
                            }
                        }
                    },
                    {"data": "paymentDay", 'sClass': "text-center",'width': '7%',
                        "render":function( data, type, full, meta) {
                            if(full.type == 0){
                                return "每月"+ data +"号";
                            }else{
                                return "无";
                            }
                        }
                    },
                    {"data": "status", 'sClass': "text-center",'width': '4%',
                        "render":function( data, type, full, meta) {
                            var str = "";
                            if(data == 0){
                                str += "<span class='label label-success' style='padding-left:3px;padding-right:3px;padding-top: inherit;' >已绑定</span> ";
                            }else if(data == 1){
                                str += "<span class='label label-danger' style='padding-left:3px;padding-right:3px;padding-top: inherit;' >已解绑</span> ";
                            }
                            return str;
                        }
                    },
                    {"data": "payStatus", 'sClass': "text-center",'width': '4%',
                        "render":function( data, type, full, meta) {
                            var str = "";
                            if (full.status == 0) {
                                if(data == 0){
                                    if (full.payError == 1) {
                                        str += "<span class='label label-warning' style='padding-left:3px;padding-right:3px;padding-top: inherit;' >支付异常</span> ";
                                    } else {
                                        str += "<span class='label label-success' style='padding-left:3px;padding-right:3px;padding-top: inherit;' >正常</span> ";
                                    }
                                }else if(data == 1){
                                    str += "<span class='label label-danger' style='padding-left:3px;padding-right:3px;padding-top: inherit;' >不可支付</span> ";
                                }
                            }
                            return str;
                        }
                    },
                    {"data": "createTime", 'sClass': "text-center","width":"12%",
                        "render": function ( data, type, full, meta ) {
                            return toDate(data).format('yyyy-MM-dd HH:mm:ss');
                        }
                    },
                    {"data":"id" , 'sClass': "text-center","width":"10%",
                        "render": function (data, type, full, meta ) {
                            var str = "<a href = '#' title='查看消费记录' onclick=viewCardCostDetail(" + data +");><i class='\glyphicon glyphicon-eye-open'></i></a>&nbsp;&nbsp;&nbsp;";
                            str += "<a href = '#' title='查看月度账单' onclick=viewCardMonthDetail(" + data +");><i class='\glyphicon glyphicon-record'></i></a>&nbsp;&nbsp;&nbsp;";
                            return str;
                        }
                    }
                ],
                //是否开启主题
                "bJQueryUI": true,
                "oLanguage": {    // 语言设置
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "sZeroRecords": "没有检索到数据",
                    "sSearch": "检索:",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    }
                }
            });
        }

        //用户众筹记录信息
        function showUserCrowdfund(){
            var searchCrowd = $("#searchCrowd").val();
            var table = $('#crowdfundList').DataTable({
                "destroy": true,   //可以重新初始化，用于搜索
                "lengthChange": false,
                "ordering": false,   //排序
                "info": true,		   //
                "autoWidth": false,   //宽度自动
                "paging": true,      //分页
                "searching": false,  //全局搜索关闭
                "processing": true,  //开启显示‘正在加载.../processing’
                "serverSide":true,   //true代表后台处理分页，false代表前台处理分页
                "ajax" :  {
                    url:"/crowdfund/getCrowdfundList",
                    type:"post",
                    data:{
                        "keyWord" : searchCrowd,
                        "flag" : $("#flag").val(),
                        "uid" : id
                    },
                    dataSrc: function (myJson) {
                        return myJson.data.data;
                    }
                },
                //参数显示
                "columns": [
                    {"data": "title", 'sClass': "text-center",'width': '12%'},
                    {"data": "type", 'sClass': "text-center",'width': '5%',
                        "render": function ( data, type, full, meta ) {
                            var str ;
                            if(data == 1){
                                str = "江湖救急"
                            }else if(data == 2){
                                str = "还房贷";
                            }else if(data == 3){
                                str = "还车贷";
                            }else if(data == 4){
                                str = "还信用卡";
                            }else if(data == 5){
                                str = "求助";
                            }
                            return str;
                        }
                    },
                    {"data": "userAccount", 'sClass': "text-center",'width': '6%'},
                    {"data": "targetMoney", 'sClass': "text-center",'width': '6%'},
                    {"data": "currentMoney", 'sClass': "text-center",'width': '6%'},
                    {"data": "billMoney", 'sClass': "text-center",'width': '6%'},
                    {"data": "img", 'sClass': "text-center",'width': '8%',
                        "render": function ( data, type, full, meta ) {
                            if(data == ''){
                                return "无";
                            }else{
                                var path = data.split("$")[0];
                                return "<img  style='width: 98px;height: 42px; '  src='"+path+"' onclick=maxPic('"+path+"')>";
                            }
                        }
                    },
                    {"data": "startTime", 'sClass': "text-center",'width': '6%',
                        "render": function ( data, type, full, meta ) {
                            return toDate(data).format('yyyy-MM-dd');
                        }
                    },
                    {"data": "endTime", 'sClass': "text-center",'width': '6%',
                        "render": function ( data, type, full, meta ) {
                            return toDate(data).format('yyyy-MM-dd');
                        }
                    },
                    {"data": "status", 'sClass': "text-center",'width': '6%',
                        "render": function ( data, type, full, meta ) {
                            var str = "";
                            if(data==0){
                                str="<span class='label label-danger' style='padding-left:10px;padding-right:10px;padding-top: inherit;'>待审核</span>";
                            }
                            if(data==1){
                                str="<span class='label label-success' style='padding-left:10px;padding-right:10px;padding-top: inherit;' >进行中</span> ";
                            }
                            if(data == 2) {
                                str="<span class='label label-warning' style='padding-left:10px;padding-right:10px;padding-top: inherit;'>付款中</span>";
                            }
                            if(data == 3) {
                                str="<span class='label label-default' style='background-color:gray;padding-left:10px;padding-right:10px;padding-top: inherit;'>已完成</span>";
                            }
                            if(data == 4){
                                str="<span class='label label-success' style='padding-left:10px;padding-right:10px;padding-top: inherit;' >进行中(已扣分)</span> ";
                            }
                            if(data == 5){
                                str="<span class='label label-danger' style='padding-left:10px;padding-right:10px;padding-top: inherit;'>已驳回</span>";
                            }
                            if(data == 6){
                                str="<span class='label label-default' style='background-color:gray;padding-left:10px;padding-right:10px;padding-top: inherit;'>已失效</span>";
                            }
                            return str;
                        }
                    },
                    // {"data": "id" , 'sClass': "text-center" ,'width':'7%',
                    //     "render": function (data, type, full, meta ) {
                    //         var str ="";
                    //         if(full.status == 0){
                    //             str += "<a href = '#' title='审核通过' onclick=checkPass(" + data +");><i class='\glyphicon glyphicon-ok'></i></a>&nbsp;&nbsp;&nbsp;";
                    //         }
                    //         if(full.status  == 0){
                    //             str += "<a href = '#' title='扣分' onclick=checkNotPass("+data+");><i class='\glyphicon glyphicon-remove'></i></a>&nbsp;&nbsp;&nbsp;";
                    //         }
                    //         if(full.status == 0){
                    //             str += "<a href = '#' title='驳回' onclick=checkBack("+data+","+full.uid+");><i class='\glyphicon glyphicon-repeat'></i></a>&nbsp;&nbsp;&nbsp;";
                    //         }
                    //         str += "<a href = '#' title='查看详情' onclick=viewDetail(" + data +");><i class='\glyphicon glyphicon-eye-open'></i></a>&nbsp;&nbsp;&nbsp;";
                    //         return str;
                    //     }
                    // }
                ],

                //是否开启主题
                "bJQueryUI": true,
                "oLanguage": {    // 语言设置
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "sZeroRecords": "没有检索到数据",
                    "sSearch": "检索:",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    }
                }
            });
        }

        //用户积分记录信息
        function showUserPoints(){
            var pointStartDate = $("#pointStartDate").val();
            var pointEndDate = $("#pointEndDate").val();
            if(pointStartDate>pointEndDate){
                layer.msg("截止时间必须要大于开始时间！");
                return ;
            }
            //获取总积分
            getTotPointByUser(pointStartDate,pointEndDate);
            var table = $('#pointsList').DataTable({
                "destroy": true,   //可以重新初始化，用于搜索
                "lengthChange": false,
                "ordering": false,   //排序
                "info": true,		   //
                "autoWidth": false,   //宽度自动
                "paging": true,      //分页
                "searching": false,  //全局搜索关闭
                "processing": true,  //开启显示‘正在加载.../processing’
                "serverSide":true,   //true代表后台处理分页，false代表前台处理分页
                "ajax" :  {
                    url:"/user/getUserPoints",
                    type:"post",
                    data:{
                            "startDate" : pointStartDate,
                            "endDate" : pointEndDate,
                            "userId" : id
                    },
                    dataSrc: function (myJson) {
                        return myJson.data.data;
                    }
                },
                //参数显示
                "columns": [
                    {"data": "id", 'sClass': "text-center",'width': '4%'},
                    {"data": "type", 'sClass': "text-center",'width': '8%',
                        "render": function ( data, type, full, meta ) {
                            var str ;
                            if(data == 1){
                                str = "签到"
                            }else if(data == 2){
                                str = "大转盘";
                            }else if(data == 3){
                                str = "众筹互助";
                            }else if(data == 4){
                                str = "分享朋友圈";
                            }else if(data == 5){
                                str = "分享微信好友";
                            }else if(data == 6){
                                str = "发全名红包";
                            }else if(data == 7){
                                str = "完成实名认证";
                            }else if(data == 8){
                                str = "大转盘抽奖兑换";
                            }else if(data == 9){
                                str = "积分商城兑换";
                            }
                            return str;
                        }
                    },
                    {"data": "point", 'sClass': "text-center",'width': '8%'},
                    {"data": "createTime", 'sClass': "text-center",'width': '8%',
                        "render": function ( data, type, full, meta ) {
                            return toDate(data).format('yyyy-MM-dd HH:mm:ss');
                        }
                    }
                ],

                //是否开启主题
                "bJQueryUI": true,
                "oLanguage": {    // 语言设置
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "sZeroRecords": "没有检索到数据",
                    "sSearch": "检索:",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    }
                }
            });
        }

        //获取用户总积分
        function getTotPointByUser(pointStartDate,pointEndDate){
            $("#totalPoint").text(userTotalPoint  );
            // $.ajax({
            //     type:"POST",
            //     url:"/user/getTotPointByUser",
            //     async : true,//默认就是true
            //     dataType:"json",
            //     data:{userId : id,
            //         startDate : pointStartDate,
            //         endDate : pointEndDate
            //     },
            //     success:function(result){
            //          $("#totalPoint").text(result);
            //     },
            //     failure:function(result) {
            //         layer.msg('网络错误！');
            //     },
            // });
        }

        //用户信用分记录信息
        function showUserCreditPoints(){
            var falg = $("#creditFlag").val();
            //获取总信用分
            getTotalCreditPoint(falg);
            var table = $('#creditPointsList').DataTable({
                "destroy": true,   //可以重新初始化，用于搜索
                "lengthChange": false,
                "ordering": false,   //排序
                "info": true,		   //
                "autoWidth": false,   //宽度自动
                "paging": true,      //分页
                "searching": false,  //全局搜索关闭
                "processing": true,  //开启显示‘正在加载.../processing’
                "serverSide":true,   //true代表后台处理分页，false代表前台处理分页
                "ajax" :  {
                    url:"/user/getUserCreditPoints",
                    type:"post",
                    data:{
                            "userId" : id,
                            type : falg
                    },
                    dataSrc: function (myJson) {
                        return myJson.data.data;
                    }
                },
                //参数显示
                "columns": [
                    {"data": "type", 'sClass': "text-center",'width': '8%',
                        "render": function ( data, type, full, meta ) {
                            var str ;
                            if(data == 1){
                                str = "发红包"
                            }else if(data == 2){
                                str = "互助";
                            }else if(data == 3){
                                str = "登录";
                            }else if(data == 4){
                                str = "其他";
                            }else if(data == 5){
                                str = "违规";
                            }else if(data == 6){
                                str = "申诉";
                            }
                            return str;
                        }
                    },
                    {"data": "creditPoint", 'sClass': "text-center",'width': '6%'},
                    {"data": "reason", 'sClass': "text-center",'width': '10%'},
                    {"data": "createTime", 'sClass': "text-center",'width': '8%',
                        "render": function ( data, type, full, meta ) {
                            return toDate(data).format('yyyy-MM-dd HH:mm:ss');
                        }
                    }
                ],

                //是否开启主题
                "bJQueryUI": true,
                "oLanguage": {    // 语言设置
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "sZeroRecords": "没有检索到数据",
                    "sSearch": "检索:",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    }
                }
            });
        }

        //获取用户总信用
        function getTotalCreditPoint(falg){
            $("#totalCreditPoint").text(userTotalCredit);
//             $.ajax({
//                 type:"POST",
//                 url:"/user/getTotalCreditPoint",
//                 async : true,//默认就是true
//                 dataType:"json",
//                 data:{userId : id,
//                       type : falg
//                 },
//                 success:function(result){
//                     $("#totalCreditPoint").text(result.data.total);
//                 },
//                 failure:function(result) {
//                     layer.msg('网络错误！');
//                 },
//             });

        }


        //打开编辑用户页面
        function editUserInfo(){
            $("#result").text("");
            var us = $("#id").text();
            $("#editUser").show();
            $.ajax({
                type:"POST",
                url:"/user/getUserById",
                async : true,//默认就是true
                dataType:"json",
                data:{id : id},
                success:function(result){
                    $.each(result.data.user,function(key,value){

                        if(key == 'avatar') {
                            $("#img2").attr("src",value);
                        }
                        if(key == 'account'){
                            $("#accountInfo").html(value);
                        }
                        if(key == 'gender' || key == 'status' ){
                            $("#editUser select[name='"+key+"']").val(value);
                        }
                        $("#editUser input[name='"+key+"']").val(value);
                     });
                },
                error:function(error){
                }
            });

        }

        //用户可用额度记录信息
        function showUserUsableAmt(){
            var searchType = $("#searchType_usableAmt").val();
            //获取总信用分
            getTotalUsableAmt(searchType);
            var table = $('#usableAmtList').DataTable({
                "destroy": true,   //可以重新初始化，用于搜索
                "lengthChange": false,
                "ordering": false,   //排序
                "info": true,		   //
                "autoWidth": false,   //宽度自动
                "paging": true,      //分页
                "searching": false,  //全局搜索关闭
                "processing": true,  //开启显示‘正在加载.../processing’
                "serverSide":true,   //true代表后台处理分页，false代表前台处理分页
                "ajax" :  {
                    url:"/user/getUserUsableAmtList",
                    type:"post",
                    data:{
                        "userId" : id,
                        "type" : searchType
                    },
                    dataSrc: function (myJson) {
                        return myJson.data.data;
                    }
                },
                //参数显示
                "columns": [
                    {"data": "type", 'sClass': "text-center",'width': '8%',
                        "render": function ( data, type, full, meta ) {
                            var str ;
                            if(data == 0){
                                str = "永久额度"
                            } else if(data == 1){
                                str = "临时额度";
                            }
                            return str;
                        }
                    },
                    {"data": "money", 'sClass': "text-center",'width': '6%'},
                    {"data": "remark", 'sClass': "text-center",'width': '10%'},
                    {"data": "orderTime", 'sClass': "text-center",'width': '8%',
                        "render": function ( data, type, full, meta ) {
                            return toDate(data).format('yyyy-MM-dd HH:mm:ss');
                        }
                    }
                ],

                //是否开启主题
                "bJQueryUI": true,
                "oLanguage": {    // 语言设置
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "sZeroRecords": "没有检索到数据",
                    "sSearch": "检索:",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    }
                }
            });
        }

        //获取用户总信用
        function getTotalUsableAmt(searchType){
            $.ajax({
                type:"POST",
                url:"/user/getTotalUsableAmt",
                async : true,//默认就是true
                dataType:"json",
                data:{
                    userId : id,
                    type : searchType
                },
                success:function(result){
                    $("#usableAmt").text(result.data.usableAmt);
                    $("#fixedAmt").text(result.data.fixedAmt);
                    $("#permanentAmt").text(result.data.permanentAmt);
                    $("#userUsableAmt").text(result.data.usableAmt);
                },
                failure:function(result) {
                    layer.msg('网络错误！');
                },
            });

        }

        //关闭用户信息编辑窗口
        function closePanel(){
            $("#editUser").hide();
        }

        $(".remove").click(function(e){
            closePanel();
        })

        //众筹信息审核通过
        function checkPass(id){
            if(confirm("确定审核通过该众筹单？")){
                submitCheck(id,1);
            }
        }
        //提交审核通过
        function submitCheck(id,status) {
            $.ajax({
                url:"/crowdfund/editCrowdfundStatus",
                type:"POST",
                async : true,//默认就是true
                dataType:"json",
                data:{id : id,status : status},
                success:function(data) {
                    layer.msg(data.msg);
                    showUserCrowdfund();
                }
            });
        }
        //上传的账单信息不通过，弹出扣分界面
        var cid ;
        function checkNotPass(crowdfundId){
            $("#punishDialog").modal("toggle");
            cid = crowdfundId;
        }

        //确定处罚扣分
        function confirmSubmit() {
            var reso = $("#reason").val();
            if( $.trim(reso)  == ""){
                layer.msg("扣分原因不能为空");
                return ;
            }
            //1、通过审核
           // submitCheck(cid,4);
            //2、进行信用分扣除
            $.ajax({
                url:"/crowdfund/editCreditScoreByUserId",
                type:"POST",
                async : true,//默认就是true
                dataType:"json",
                data:{
                    userId : id ,
                    score : $("#punishScore").val(),
                    reason : $("#reason").val(),
                    cid: cid,
                    status :4,
                    id : cid,
                    type : 5   //信用类型(1发红包 2互助 3登录 4其他 5违规)
                },
                success:function(data) {
                    layer.msg(data.msg);
                    $("#punishDialog").modal("toggle");
                    showUserCrowdfund();
                }
            });
        }

        //驳回弹框
        var bcid ;
        function checkBack(crowdfundId,uid){
            $("#rejectDialog").modal("toggle");
            bcid = crowdfundId;
        }
        //确定驳回
        function confirmReject() {
            var reso = $("#rejectResion").val();
            if( $.trim(reso)  == ""){
                layer.msg("驳回原因不能为空");
                return ;
            }
            //2、进行信用分扣除
            $.ajax({
                url:"/crowdfund/updCrowd",
                type:"POST",
                async : true,//默认就是true
                dataType:"json",
                data:{
                    rejectResion : reso,
                    cid :bcid,
                    status :5
                },
                success:function(data) {
                    layer.msg(data.msg);
                    $("#rejectDialog").modal("toggle");
                    location.reload();
                }
            });
        }

        //选择常用驳回理由
        function selRejectText() {
            var sel = $("#selRejectReason").val();
            $("#rejectResion").val(sel);
        }

        //上传图片
        function uploadPic() {
            var formData=new FormData();
            formData.append("pic",document.getElementById("picUrl").files[0]);
            formData.append("type",3);
            $.ajax({
                type : 'post',
                url : "/upload/uploadPicFile",
                data:formData,
                contentType: false,
                processData: false,
                success : function(data) {
                    let url = data.data.url;
                    $("#img2").attr("src",url);
                    $("#head").val(url)
                }
            });
        }

        //查看众筹单筹款详情
        function viewDetail(id){
            window.location.href="../crowdfund/crowdfundDetail.html?crdId="+id;
        }


        //保存用户信息
        $("#editUserInfoSub").click(function(){
            // if($("#idCards").val() == ""){
            //     layer.msg("身份证不能为空！");
            //     return ;
            // }
            var formdata = $("#editUserForm").serializeObject();

            var url = "/user/updateUser";
            $.ajax({
                url:url,
                data:JSON.stringify(formdata),
                type:"POST",
                contentType: "application/json; charset=utf-8",
                dataType:"JSON",
                success:function(data) {
                    if(data.code == 0) {
                        $("#editUser").hide();
                        layer.msg("更新用户信息成功！");
                        showUserInfo(id);
                    } else {
                        $("#editUser").hide();
                        history.go(0);
                        $("#editUser .mess").html("");
                    }
                },
                error:function(error) {
                    $("#editUser .mess").html("更新用户信息失败，请稍后重试!");
                },

            });
        });

        //查看消费记录详情
        function viewCardCostDetail(id) {
            var table = $('#cardCostList').DataTable({
                "destroy": true,   //可以重新初始化，用于搜索
                "lengthChange": false,
                "ordering": false,   //排序
                "info": true,		   //
                "autoWidth": false,   //宽度自动
                "paging": true,      //分页
                "searching": false,  //全局搜索关闭
                "processing": true,  //开启显示‘正在加载.../processing’
                "serverSide":true,    //true代表后台处理分页，false代表前台处理分页
                "ajax" :  {
                    url:"/card/getCardCostRecord",
                    type:"post",
                    data:{
                        cardId : id
                    }
                },
                //参数显示
                "columns": [
                    {"data": "cardSuffix", 'sClass': "text-center",'width': '6%'},
                    {"data": "transAmount", 'sClass': "text-center",'width': '5%'},
                    {"data": "transDesc", 'sClass': "text-center",'width': '15%'},
                    {"data": "transDate", 'sClass': "text-center",'width': '10%'},
                    {"data": "postDate", 'sClass': "text-center",'width': '10%'}
                ],
                //是否开启主题
                "bJQueryUI": true,
                "oLanguage": {    // 语言设置
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "sZeroRecords": "没有检索到数据",
                    "sSearch": "检索:",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    }
                }
            });
            $("#cardCostDialog").modal("toggle");
        }

        //查看月度账单
        function viewCardMonthDetail(id) {
            var table = $('#cardMonthList').DataTable({
                "destroy": true,   //可以重新初始化，用于搜索
                "lengthChange": false,
                "ordering": false,   //排序
                "info": true,		   //
                "autoWidth": false,   //宽度自动
                "paging": true,      //分页
                "searching": false,  //全局搜索关闭
                "processing": true,  //开启显示‘正在加载.../processing’
                "serverSide":true,    //true代表后台处理分页，false代表前台处理分页
                "ajax" :  {
                    url:"/card/getCardMonthRecord",
                    type:"post",
                    data:{
                        cardId : id
                    }
                },
                //参数显示
                "columns": [
                    {"data": "cardSuffix", 'sClass': "text-center",'width': '6%'},
                    {"data": "transAmount", 'sClass': "text-center",'width': '5%'},
                    {"data": "transDesc", 'sClass': "text-center",'width': '15%'},
                    {"data": "transDate", 'sClass': "text-center",'width': '10%'},
                    {"data": "postDate", 'sClass': "text-center",'width': '10%'}
                ],
                //是否开启主题
                "bJQueryUI": true,
                "oLanguage": {    // 语言设置
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "sZeroRecords": "没有检索到数据",
                    "sSearch": "检索:",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    }
                }
            });
            $("#cardMonthDialog").modal("toggle");
        }

        //选择常用扣分理由
        function selText() {
            var sel = $("#selReason").val();
            $("#reason").val(sel);
        }

    </script>
</html>
